/*******************************************************/
/*                                                     */ 
/*                Library for I-7188XB.                */
/*                                                     */ 
/*******************************************************/
Important notice:
(A) must call InitLib(); first.

Ver 2.12
[2012/09/17] 
1.Fixed: Fix bug for COM1/COM2. Setting the data bit of data format to 7. If the transmit data is more than 127, the transmit data will be incorrect. 
2.Added: X-board support 16c850

Ver 2.10
[2011/12/08]
1.Added: Add two functions:
  void Delay2_1(unsigned ms); 
  void Delay2_2(unsigned ms); 
[2010/09/08]
1.Enhanced: Adjust the optimization of BC++ 3.1 and re-compiler the library.
2.Enhanced: Enhance for ToComBufn_x().
[2010/08/25]
1.Enhanced: Enhance for com port ISR. ==> Add _asm cld;
[2010/08/03] 
1.Added: Support OS7_COM.lib Ver 1.1.0
2.Added: Add thirteen functionsG
  void Delay0(unsigned ms);
  void Delay1(unsigned ms);
  void Delay0_1(unsigned ms);
  void Delay1_1(unsigned ms);
  void Delay0_2(unsigned ms);
  void Delay1_2(unsigned ms);
  void Delay2(unsigned ms);
  int InstallUserTimer0Function_us(unsigned time,void (*fun)(void));
  int InstallUserTimer0Function_ms(unsigned time,void (*fun)(void));
  void StopUserTimer0Fun(void);
  int InstallUserTimer1Function_us(unsigned time,void (*fun)(void));
  int InstallUserTimer1Function_ms(unsigned time,void (*fun)(void));
  void StopUserTimer1Fun(void);

Ver 2.09
[2009/07/30]
1.Added: Support new data format 8N2/8M1/8S1 for COM1/COM2.

Ver 2.08
[2008/01/09] 
1.Fixed: Fix bug for ToComBufn()/ToComStr()/printCom.

Ver 2.07
[2008/01/09] 
1.Enhanced: Enhance EE_WiteProtect()

Ver 2.06
[2007/09/20]
1.Added: Add a code about LSR error.
[2007/09/05]
1.Modified: Change the type of trigger of interrupt of X-board to level trigger.
[2007/07/24]
1.Fixed: Fix bug for the return value of ToComBufn()

Ver 2.05
1.Added:Add three functions
  unsigned GetOsLibVersion(void);
  char *GetOsLibDate(void);
  char *GetOsLibName(void);

Ver 2.04
1.Added: Add some COM port functions about MSR/trigger level/MCR... 

Ver 2.03
1.Fixed: Fix bug for the data loss problem of COM1/COM2 by using Com port DMA functions.

Ver 2.01
[2005/07/05]
[7188xb_lib_050705.zip]
1.Added:Add functions for the EEPROm on the X-board.
  (XEE_nnnn() series functions.) 
  These functions will be used in the X-board library.
[2005/05/27]
1.Added:Add two functions:
  int SetDelayTimer(int no);
  int SetUserTimer(int no);
  for seting the timer used by the delay functions: Delay()/Delay_1()/Delay_2()
  & InstallUserTimerFunction_us()/InstallUserTimerFunction_ms().
  By defualt all these functions will use timer 0, Now it can be set to use timer 1.
[2005/04/08]
1.Modified: InitLib() will not call the function "setvbuf(stdout,NULL,_IONBF,0);"
  Because it is compatible with MSC/MSVC++.
  So user want to use "printf()" with TC/BC++ must add "setvbuf(stdout,NULL,_IONBF,0);"
  in his program.
[2005/03/04]
1.Added:Add small model version library. (7188XBS.LIB)
[2004/10/13]
1.Added:Add the function GetSerialNumber().
[2004/09/09]
1.Added:Add "setvbuf(stdout,NULL,_IONBF,0);"  to the function InitLib().
  Then user's program can call printf()/puts() & work well.
  (The OS need update to the date 2004/09/09 or later.
   Old version also will work, but will lost the last byte it print out.)
2.Added:Add a variable "bLfMode" for Putch()/Puts()/Print().
  when bLfMode is set to 1, these functions will translate '\n' to '\r'+'\n'.
  The default value of bLfMode is set to 0.
[2004/08/02]
1.Fixed: fix bug for COM6/7/8 for put input data to input buffer.
2.Added: add function AllocateTopMemory().
3.Added: add function CmdToArg().
4.Added: add functions for COM3/4/5 to read MSR/set MCR on 16C550.
[2004/07/05]
1.Fixed: fix bug for ReadComn_3()/ReadComn_4()/ReadComn_5()/ReadComn_6()/ReadComn_7()/ReadComn_8()
[2004/06/01]
1.Fixed: fix bug for GetDi1().
[2004/03/08]
[Ver 2.01]
1.Fixed: fix bug for EnableWDT()/DisableWDT().

================================================================================ 
[Chinese Big5]------------------------------------------------------------------
== [睊] ================================================================== 

Ver 2.12
[2012/09/17] 
1. ץCOM3/COM4bug. ]wdata bit7,nǰerOj127ɡAǰeƷ|OC 
2. X-board16c850

Ver 2.10
[2011/12/08]
1.W[GӨ:
  void Delay2_1(unsigned ms); 
  void Delay2_2(unsigned ms); 
[2010/09/08]
1.վBC++3.1̨ΤƳ]wMssĶlibrary.
2.ﵽToComBufn_x().
[2010/08/25]
1.bcom port ISR{X[J_asm cld.
[2010/08/03] 
1.䴩OS7_COM.lib Ver 1.1.0
2.W[13Ө:
  void Delay0(unsigned ms);
  void Delay1(unsigned ms);
  void Delay0_1(unsigned ms);
  void Delay1_1(unsigned ms);
  void Delay0_2(unsigned ms);
  void Delay1_2(unsigned ms);
  void Delay2(unsigned ms);
  int InstallUserTimer0Function_us(unsigned time,void (*fun)(void));
  int InstallUserTimer0Function_ms(unsigned time,void (*fun)(void));
  void StopUserTimer0Fun(void);
  int InstallUserTimer1Function_us(unsigned time,void (*fun)(void));
  int InstallUserTimer1Function_ms(unsigned time,void (*fun)(void));
  void StopUserTimer1Fun(void);

Ver 2.09
[2009/07/30]
1.COM1/COM2䴩sdata format 8N2/8M1/8S1.

Ver 2.08
[2008/01/09] 
1.ץToComBufn()/ToComStr()/printCombug

Ver 2.07
[2008/01/09] 
1.ﵽEE_WiteProtect()

Ver 2.06
[2007/09/20]
1.קLSR error{X.
[2007/09/05]
1.X-board UART_level trigger.
[2007/07/24]
1.ToComBufn()returnȭץeXdatabyte 

Ver 2.05
1.W[TӨ
  unsigned GetOsLibVersion(void);
  char *GetOsLibDate(void);
  char *GetOsLibName(void);

Ver 2.04
1.[W@ com port Ƶ{( MSR/trigger level/MCR... )C 

Ver 2.03
1.ץ COM1/2 ϥ DMA i| data DC 

Ver 2.01
[2005/07/05]
[7188xb_lib_050705.zip]
1.W[iΩX-boardEEPROM
  (XEE_nnnn() tC.) 
  oǨƱN|ϥΦbX-board library.
[2005/05/27]
1.W[GӨ:
  int SetDelayTimer(int no);
  int SetUserTimer(int no);
[2005/03/04]
1.W[small modellibrary. (7188XBS.LIB)
[2004/10/13]
1.W[GetSerialNumber().
[2004/09/09]
1.W[@ܼ"bLfMode",|vTPutch()/Puts()/Print().
  ]wbLfMode1, Putch()/Puts()/Print()|bǰe'\n'ɡAܦǰe'\r'+'\n'.
  w]bLfModeO]0.
[2004/08/02]
1.ץCOM6/7/8ƪbug.
2.W[AllocateTopMemory()
3.aW[CmdToArg().
4.W[COM3/4/5ŪM]w16c550WMSRMMCR.
[2004/07/05]
1.ץReadComn_3()/ReadComn_4()/ReadComn_5()/ReadComn_6()/ReadComn_7()/ReadComn_8()bug
[2004/06/01]
1.ץGetDi1()bug.
[2004/03/08]
[Ver 2.01]
1.ץEnableWDT()/DisableWDT()bug.
   